package nancal.mp.db.mongo.table

import java.io.*
import nbcp.base.db.*
import nbcp.base.comm.*
import nbcp.base.extend.*
import nbcp.base.enums.*
import nbcp.base.utils.*
import nbcp.myoql.db.*
import nbcp.myoql.db.comm.*
import nbcp.myoql.db.enums.*
import nbcp.myoql.db.mongo.*
import nbcp.myoql.db.mongo.base.*
import nbcp.myoql.db.mongo.component.*
import org.slf4j.LoggerFactory
import org.springframework.stereotype.*


@Component("mongo.log")
@MetaDataGroup(DatabaseEnum.Mongo, "log")
class LogGroup : IDataGroup {
    override fun getEntities(): Set<BaseMetaData<out Any>> = setOf(corpLoginLog, emailCodeLog, mobileCodeLog, orderLog, withdrawalLog, wxStartLog)



    val corpLoginLog get() = CorpLoginLogEntity();




    val emailCodeLog get() = EmailCodeLogEntity();




    val mobileCodeLog get() = MobileCodeLogEntity();




    val orderLog get() = OrderLogEntity();




    val withdrawalLog get() = WithdrawalLogEntity();




    val wxStartLog get() = WxStartLogEntity();



    @org.springframework.data.mongodb.core.mapping.Document()
    @nbcp.base.db.annotation.DbEntityGroup(value = """log""")
    class CorpLoginLogEntity(collectionName: String = "corpLoginLog") :
        MongoBaseMetaCollection<nancal.mp.db.mongo.entity.log.CorpLoginLog>(nancal.mp.db.mongo.entity.log.CorpLoginLog::class.java, collectionName) {

        val id = MongoColumnName("_id")

        val loginName = MongoColumnName("loginName")

        val password = MongoColumnName("password")

        val app = MongoColumnName("app")

        val clientIp = MongoColumnName("clientIp")

        val client = MongoColumnName("client")

        val remark = MongoColumnName("remark")

        /**
         * 创建时间
         */
        @nbcp.base.db.annotation.Cn(value = """创建时间""") 
        val createAt = MongoColumnName("createAt")

        /**
         * 更新时间
         */
        @nbcp.base.db.annotation.Cn(value = """更新时间""") 
        val updateAt = MongoColumnName("updateAt")

    }


    @org.springframework.data.mongodb.core.mapping.Document()
    @nbcp.base.db.annotation.DbEntityGroup(value = """log""")
    class EmailCodeLogEntity(collectionName: String = "emailCodeLog") :
        MongoBaseMetaCollection<nancal.mp.db.mongo.entity.log.EmailCodeLog>(nancal.mp.db.mongo.entity.log.EmailCodeLog::class.java, collectionName) {

        val id = MongoColumnName("_id")

        val module = MongoColumnName("module")

        val emails = MongoColumnName("emails")

        val subject = MongoColumnName("subject")

        val content = MongoColumnName("content")

        val isRead = MongoColumnName("isRead")

        /**
         * 创建时间
         */
        @nbcp.base.db.annotation.Cn(value = """创建时间""") 
        val createAt = MongoColumnName("createAt")

        /**
         * 更新时间
         */
        @nbcp.base.db.annotation.Cn(value = """更新时间""") 
        val updateAt = MongoColumnName("updateAt")

    }


    @org.springframework.data.mongodb.core.mapping.Document()
    @nbcp.base.db.annotation.DbEntityGroup(value = """log""")
    class MobileCodeLogEntity(collectionName: String = "mobileCodeLog") :
        MongoBaseMetaCollection<nancal.mp.db.mongo.entity.log.MobileCodeLog>(nancal.mp.db.mongo.entity.log.MobileCodeLog::class.java, collectionName) {

        val id = MongoColumnName("_id")

        val module = MongoColumnName("module")

        val mobile = MongoColumnName("mobile")

        val templateCode = MongoColumnName("templateCode")

        val param = MongoColumnName("param")

        val bizId = MongoColumnName("bizId")

        val result = ObjectMeta("result")

        val errorMessage = MongoColumnName("errorMessage")

        val sentAt = MongoColumnName("sentAt")

        val arrivedAt = MongoColumnName("arrivedAt")

        /**
         * 创建时间
         */
        @nbcp.base.db.annotation.Cn(value = """创建时间""") 
        val createAt = MongoColumnName("createAt")

        /**
         * 更新时间
         */
        @nbcp.base.db.annotation.Cn(value = """更新时间""") 
        val updateAt = MongoColumnName("updateAt")

    }


    @org.springframework.data.mongodb.core.mapping.Document()
    @nbcp.base.db.annotation.DbEntityGroup(value = """log""")
    class OrderLogEntity(collectionName: String = "orderLog") :
        MongoBaseMetaCollection<nancal.mp.db.mongo.entity.log.OrderLog>(nancal.mp.db.mongo.entity.log.OrderLog::class.java, collectionName) {

        val id = MongoColumnName("_id")

        val orderId = MongoColumnName("orderId")

        val msg = MongoColumnName("msg")

        val beforeData = MongoColumnName("beforeData")

        val afterData = MongoColumnName("afterData")

        val createBy = OpenIdNameMeta("createBy")

        /**
         * 创建时间
         */
        @nbcp.base.db.annotation.Cn(value = """创建时间""") 
        val createAt = MongoColumnName("createAt")

        /**
         * 更新时间
         */
        @nbcp.base.db.annotation.Cn(value = """更新时间""") 
        val updateAt = MongoColumnName("updateAt")

    }


    @org.springframework.data.mongodb.core.mapping.Document()
    @nbcp.base.db.annotation.DbEntityGroup(value = """log""")
    class WithdrawalLogEntity(collectionName: String = "withdrawalLog") :
        MongoBaseMetaCollection<nancal.mp.db.mongo.entity.log.WithdrawalLog>(nancal.mp.db.mongo.entity.log.WithdrawalLog::class.java, collectionName) {

        val id = MongoColumnName("_id")

        val code = MongoColumnName("code")

        val user = OpenIdNameUrlMeta("user")

        val amount = MongoColumnName("amount")

        val bankName = MongoColumnName("bankName")

        val bankNumber = MongoColumnName("bankNumber")

        val bankZhiName = MongoColumnName("bankZhiName")

        val remark = MongoColumnName("remark")

        val done = MongoColumnName("done")

        /**
         * 创建时间
         */
        @nbcp.base.db.annotation.Cn(value = """创建时间""") 
        val createAt = MongoColumnName("createAt")

        /**
         * 更新时间
         */
        @nbcp.base.db.annotation.Cn(value = """更新时间""") 
        val updateAt = MongoColumnName("updateAt")

    }


    @org.springframework.data.mongodb.core.mapping.Document()
    @nbcp.base.db.annotation.DbEntityGroup(value = """log""")
    class WxStartLogEntity(collectionName: String = "wxStartLog") :
        MongoBaseMetaCollection<nancal.mp.db.mongo.entity.log.WxStartLog>(nancal.mp.db.mongo.entity.log.WxStartLog::class.java, collectionName) {

        val id = MongoColumnName("_id")

        val path = MongoColumnName("path")

        val scene = MongoColumnName("scene")

        val query = ObjectMeta("query")

        val shareTicket = MongoColumnName("shareTicket")

        val referrerInfo = ObjectMeta("referrerInfo")

        val openid = MongoColumnName("openid")

        val userName = MongoColumnName("userName")

        /**
         * 创建时间
         */
        @nbcp.base.db.annotation.Cn(value = """创建时间""") 
        val createAt = MongoColumnName("createAt")

        /**
         * 更新时间
         */
        @nbcp.base.db.annotation.Cn(value = """更新时间""") 
        val updateAt = MongoColumnName("updateAt")

    }

}

